<?php

function x2p($string)
{
	$string = '<p>' . nl2br(preg_replace('#([\r\n]\s*?[\r\n]){2,}#', '</p><p>', $string)) . '</p>';
	return str_replace('</p><p>', '</p>
<p>', $string);
}

function clean($string)
{
	return x2p(stripslashes($string));
}


?>